'use strict';

// 写增删改查的业务逻辑
// 写在Service里 然后controller调用Service
const Service = require('egg').Service;
const uuid = require('uuid');
class UserRelationService extends Service {

  async addUserInfo(user, transaction) {
    console.log('--------------addUserRelation-----------------------');
    console.log(user);
    user.id = uuid.v1().replace(new RegExp('-', 'gm'), '');

    const users = await this.app.model.UserRelation.create(user, { transaction });
    // 返回保存用户的信息
    return users;
  }


}

module.exports = UserRelationService;
